cmake_minimum_required (VERSION 2.8)

# include common file
INCLUDE( ../../CMakeCommonFile.txt )

# set current directory name as target name
GLIB_GET_CURRENT_DIR_NAME(${CMAKE_CURRENT_SOURCE_DIR} CURRENT_DIR_NAME)

# set var
SET (TARGET_NAME ${CURRENT_DIR_NAME})

# like -I
INCLUDE_DIRECTORIES(
	${GLIB_INCLUDE_DIR}
	${GLIB_CONFIG_INCLUDE_DIR}
)

# like -L and -Wl,-rpath=
#LINK_DIRECTORIES(${GLIB_DIR}/lib/glib-2.0/)

# target name
PROJECT (${TARGET_NAME})

# add custom source files
FILE (GLOB CURRENT_SOURCES "*.c" "*.cpp" "./subdir/*.c" "./subdir/*.cpp")
FILE (GLOB CURRENT_INCLUDES "*.h" "*.hpp" "./subdir/*.h"  "./subdir/*.hpp")
SET (CURRENT_SRCS ${CURRENT_SOURCES} ${CURRENT_INCLUDES})
ADD_EXECUTABLE (${TARGET_NAME}  ${CURRENT_SRCS})

# add src
#AUX_SOURCE_DIRECTORY (. DIR_SRCS)
#ADD_EXECUTABLE (${TARGET_NAME}  ${DIR_SRCS})

# like -lglib-2.0
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${GLIB_LINK_LIB})